package com.flyxiaozhu.erp.core.entities;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

@Entity
@Data
@DynamicInsert
@DynamicUpdate
@Table(indexes = {
        @Index(columnList = "skuId"),
        @Index(columnList = "goodsId")
})
public class GoodsOrderDetail extends BaseEntity {
    @Column(columnDefinition = "int(11) not null default 0 comment '订单ID'")
    private long orderId;

    @Column(columnDefinition = "int(11) not null default 0 comment '商品ID'")
    private long goodsId;

    @Column(columnDefinition = "varchar(255) not null default '' comment '商品名称'")
    private String goodsName;

    @Column(columnDefinition = "varchar(32) not null default '' comment '商品编号'")
    private String goodsNo;

    @Column(columnDefinition = "varchar(255) not null default '' comment '商品缩略图'")
    private String goodsThumb;

    @Column(columnDefinition = "int(11) not null default 0 comment '商品SKU ID'")
    private long skuId;

    @Column(columnDefinition = "varchar(50) not null default '' comment '规格，即什么尺寸什么颜色'")
    private String skuDesc;

    @Column(columnDefinition = "int(11) not null default 0 comment '购买数量'")
    private int goodsNum;

    @Column(columnDefinition = "int(11) not null default 0 comment '销售单价'")
    private long sellingPrice;

    @Column(columnDefinition = "int(11) not null default 0 comment '销售总金额'")
    private long sellingAmount;

    @Column(columnDefinition = "varchar(32) not null default '' comment '快递公司代码'")
    private String expressCode;

    @Column(columnDefinition = "varchar(50) not null default '' comment '快递单号'")
    private String expressNo;

    @Column(columnDefinition = "tinyint(2) not null default 0 comment '发货状态'")
    private int deliveryStatus;

    @Column(columnDefinition = "datetime default null comment '发货时间'")
    private String deliveryTime;
}
